<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Test Pay</title>
</head>
<body>
<div style="text-align: center;margin-top: 100px;">

    测试，<span class="clock">8</span>秒内自动支付成功，然后关闭该页面，返回查看支付状态

</div>
<script>
    var t = 8;
    var time = document.getElementsByClassName("clock")[0];

    function fun() {
        t--;
        time.innerHTML = t;
        if(t <= 0) {
            clearInterval(inter);
        }
    }
    var inter = setInterval("fun()", 1000);
</script>
</body>
</html>